package org.company.mercury.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/basic")
public class BasicController {
    
    /**
     * contextPath/basic/redirect1.do
     * 	==>contextPath/basic/napage/main.html
     * @return
     */
    @RequestMapping("/redirect1")
    public ModelAndView redirect1() {
    	return new ModelAndView("redirect:npage/main.html");
    }
    
    /**
     * contextPath/basic/redirect2.do
     * 	==> contextPath/npage/main.html
     * @return
     */
    @RequestMapping("/redirect2")
    public ModelAndView redirect2() {
    	return new ModelAndView("redirect:/npage/main.html");
    }
    
    /**
     * contextPath/basic/forward1.do
     * 	==> contextPath/basic/npage/main.html
     * @return
     */
    @RequestMapping("/forward1")
    public ModelAndView forward1() {
    	return new ModelAndView("forward:npage/main.html");
    }
    
    /**
     * contextPath/basic/forward2.do
     * 	==>contextPath/npage/main.html
     * @return
     */
    @RequestMapping("/forward2")
    public ModelAndView forward2() {
    	return new ModelAndView("forward:/npage/main.html");
    }
    
}
